package com.yunlankeji.stemcells.fragemt.home;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.yunlankeji.ganxibaozhijia.R;
import com.yunlankeji.stemcells.adapter.Fragment_organization_videoAdapter;
import com.yunlankeji.stemcells.model.request.Organization_video;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

public class fragment_home_organization_video  extends Fragment {
    private Unbinder unbinder;
    @BindView(R.id.rv_organization_video)
    RecyclerView rv_organization_video;

    @Nullable
    @Override
    public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {

        View view=inflater.inflate(R.layout.fragment_home_organization_video,container,false);
        unbinder = ButterKnife.bind(this,view);

        List<Organization_video> organization_videoList = new ArrayList<>();

        Organization_video organization_video1 = new Organization_video("细胞分裂过程","华大基因","132",R.mipmap.icon_p1,R.mipmap.icon_p2);
        Organization_video organization_video2 = new Organization_video("巨噬细胞吞噬病毒","华大基因","6735",R.mipmap.icon_p1,R.mipmap.icon_p2);
        Organization_video organization_video3 = new Organization_video("心脏您了解吗？教您最全面的了解您的心脏","华大基因","456",R.mipmap.icon_p1,R.mipmap.icon_p2);
        Organization_video organization_video4 = new Organization_video("CAR-T细胞免疫疗法(下)","华大基因","5644",R.mipmap.icon_p1,R.mipmap.icon_p2);


        organization_videoList.add(organization_video1);
        organization_videoList.add(organization_video2);
        organization_videoList.add(organization_video3);
        organization_videoList.add(organization_video4);


        GridLayoutManager gridLayoutManager=new GridLayoutManager(getContext(),2);
        rv_organization_video.setLayoutManager(gridLayoutManager);
        Fragment_organization_videoAdapter fragment_organization_videoAdapter= new Fragment_organization_videoAdapter(organization_videoList);

        rv_organization_video.setAdapter(fragment_organization_videoAdapter);

        return view;
    }
}
